extends Node

## 场景数据管理器
var scene_data_manager = SceneDataManager.new()

func _ready() -> void:
	GlobalSignals.game_status_game_over_signal.connect(_on_game_over)
	pass

func _on_game_over(winning_side:BoardCommon.TURN) -> void:
	print("游戏结束！获胜方：", BoardCommon.TURN_NAMES[winning_side])
	get_tree().paused = true # 暂停游戏
	
class SceneDataManager:
	var storage = {}
	
	##设置场景数据
	func set_scene_data(scene_name: String, data): 
		storage[scene_name] = data
	## 获取场景数据
	func get_scene_data(scene_name: String): 
		if storage.has(scene_name):
			var data = storage[scene_name]
			storage.erase(scene_name)  # 取出后删除
			return data
		return null
